﻿#ifndef WIDGET_H
#define WIDGET_H

#include <QTimer>
#include <QWidget>
#include <deviceoperator.h>

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();
public slots:
    void getServerState();
private slots:
    void on_serviceAddDelBtn_clicked();

    void on_serviceStartStopBtn_clicked();

    void on_serviceRestartBtn_clicked();

    void on_serviceSettingBtn_clicked();

private:
    void init_ServiceControlParam();
    void seri_ServiceControlParam();

    bool writeWinSWParam();

    DeviceOperator deviceOperator;
    int serverState;
private:
    Ui::Widget *ui;
    QString servicePath;
    bool serviceSetting;
    QString serviceSettingPath;

    QString WinSWPath;
    QString WinSWConfigPath;

    QString id;
    QString logPath;
    QString logMode;
    QString executable;
    QString startArguments;
    QString stopArguments;

    QTimer m_timer;
};
#endif // WIDGET_H
